﻿namespace CodeFirsrtDemo.Migrations
{
    using System;
    using System.Data.Entity;
    using System.Data.Entity.Migrations;
    using System.Linq;

    internal sealed class Configuration : DbMigrationsConfiguration<CodeFirsrtDemo.DataContext>
    {
        public Configuration()
        {
            AutomaticMigrationsEnabled = true;
        }

        protected override void Seed(CodeFirsrtDemo.DataContext context)
        {
            context.Database.ExecuteSqlCommand("delete departments");
            //调用种子方法，初始化数据
            DeptSeed.Seed(context);
        }
    }
}
